// 订单商品
const mongoose = require('mongoose');
const goodsModel = require('./goodsModel')
const shopsModel = require('./shopsModel')
// const usersModel = require('./usersModle')
// const adminModel = require('./adminModle');
const orderGoodsSchema = new mongoose.Schema({
    count: String, // 订单商品数量
    time: String,  // 下单时间
    state: String, // 订单状态）待付款/待收货/待评价/已收货）
    goodsId: {
        type: mongoose.Schema.Types.ObjectId,
        ref: "goodsModel"
    }, // 所属订单商品id

    userId: {
        type: mongoose.Schema.Types.ObjectId,
        ref: "usersModel"
    }, //	订单商品用户id

    adminId: {
        type: mongoose.Schema.Types.ObjectId,
        ref: "adminModel"
    }, // 所属门店管理员id
    shopId: {
        type: mongoose.Schema.Types.ObjectId,
        ref: "shopsModel"
    }, // 所属门店id
});
module.exports = mongoose.model('orderGoodsModel', orderGoodsSchema, 'orderGoods');
